# -- coding: utf-8 --
# @Time : 2024/3/7 23:04
# @Author : rlh
# @File : create_database.py
# 功能描述:

# 系统第三方库
from exts import OperateDatabase
# 导入项目模块
create_table_api_data = """
CREATE TABLE api_data (
    id VARCHAR(17) NOT NULL COMMENT '接口唯一标识', 
    api_name VARCHAR(64) NOT NULL COMMENT '接口名称', 
    url_path VARCHAR(255) NOT NULL COMMENT '接口路径', 
    template VARCHAR(255) NOT NULL COMMENT '接口模板', 
    description TEXT COMMENT '接口描述', 
    create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 
    update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (id), 
    UNIQUE (api_name), 
    UNIQUE (id), 
    UNIQUE (url_path)
) COMMENT='接口数据表
"""
OperateDatabase.execute_create_sql(create_table_api_data)